package com.base.mvp.base

import android.os.Bundle
import android.support.v7.app.AppCompatActivity

/**
 * @author Administrator
 * @date 2018/1/24 0024 下午 1:13
 * GitHub：
 * email：
 * description：所有使用MVP模式的Activity需要继承这个Activity
 */
abstract class BaseMvpActivity<V : BaseMvpContract.View, out M : BaseMvpContract.Model, out P : BaseMvpContract.Presenter<V, M>> : AppCompatActivity() {
    abstract val mPresenter: P
    abstract val mView: V

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mPresenter.bindView(mView)
    }

    override fun onDestroy() {
        super.onDestroy()
        mPresenter.unbindView()
    }
}